﻿#region File Header
/***********************************************************************
 * This code is released into the public domain under WTFPL. Simply put:
 * You may use this code in whatever way you want, commercial or
 * personal.
 * 
 * Check exceltocsv.codeplex.com for updates to the original code.
************************************************************************
Author: Donald Beals
Date: September 3rd, 2013
Description: A class to simplify logging information to the Console.
****************************** Change Log ******************************
09.03.13 - Created initial file. (dbeals)
***********************************************************************/
#endregion

#region Using Statements
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
#endregion

namespace ExcelToCSV
{
	/// <summary>
	/// 
	/// </summary>
	public static class Logger
	{
		#region Variables
		private static readonly ConsoleColor warningColor = ConsoleColor.Yellow;
		private static readonly ConsoleColor errorColor = ConsoleColor.Red;
		#endregion

		#region Methods
		public static void Initialize(string[] args)
		{
			// No initialization needed at the moment
			// as this is console only.
		}

		public static void LogInformation(string message, params object[] values)
		{
			Console.WriteLine(string.Format(message, values));
		}

		public static void LogWarning(string message, params object[] values)
		{
			var oldColor = Console.ForegroundColor;
			Console.ForegroundColor = warningColor;
			Console.WriteLine(string.Format(message, values));
			Console.ForegroundColor = oldColor;
		}

		public static void LogError(string message, params object[] values)
		{
			var oldColor = Console.ForegroundColor;
			Console.ForegroundColor = errorColor;
			Console.WriteLine(string.Format(message, values));
			Console.ForegroundColor = oldColor;
		}
		#endregion
	}
}
